<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>添加用户</title>
    <script src="/plugin/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
    <link href="/plugin/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="/plugin/ligerUI/skins/Gray/css/all.css" rel="stylesheet"/>
    <link href="/css/form.css" rel="stylesheet"/>


    <script src="/plugin/ligerUI/js/core/base.js" type="text/javascript"></script>
    <script src="/plugin/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
    <script src="/plugin/jquery/jquery.validate.js"></script>

</head>
<body style="margin: 10px;">
    <form id="subForm">
       <div class="formDiv" style="width: 95%;">
            <div class="formLine">
                <input  type="hidden" name="id" th:value="${infos.UUID}" />
                <input  type="hidden" name="createTime" th:value="${infos.createDate}" />
                <input  type="hidden" name="deleted" value="0">
                <input  type="hidden" name="orgId" id="orgId" value="">
                <div class="formInp">
                    <span>用&nbsp;户&nbsp;&nbsp;名：</span>
                    <input class="blue testTxt" type="text"
                            name="userName" placeholder="必填" required data-msg-required="不能为空" value=""/>
                </div>
                <div class="formInp">
                    <span>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</span>
                    <input class="blue testTxt" type="text" placeholder="必填" required data-msg-required="不能为空"  name="account" value=""/>
                </div>
            </div>
           <div class="formLine">

               <div class="formInp">
                   <span>手机号码：</span>
                   <input class="blue testTxt"  type="text" placeholder="必填" required data-msg-required="不能为空" name="mobile" value=""/>
               </div>
               <div class="formInp">
                   <span>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱：</span>
                   <input class="blue testTxt" placeholder="必填" required data-msg-required="不能为空"   type="text" name="email" value=""/>
               </div>
           </div>

           <div class="formLine">
               <div class="formInp">
                   <span>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</span>
                   <select class="blue testTxt" name="sex">
                       <option value="0">女</option>
                       <option value="1">男</option>
                   </select>
               </div>
               <div class="formInp">
                   <span>状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态：</span>
                   <select class="blue testTxt" name="status">
                       <option value="0">不可用</option>
                       <option value="1">可用</option>
                   </select>
               </div>
           </div>

           <div class="formLine">
               <div class="formInp">
                   <span>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：</span>
                   <input class="blue testTxt" placeholder="必填" required data-msg-required="不能为空"  type="text" name="addr" value=""/>
               </div>

               <div class="formInp">
                   <span>账号密码：</span>
                   <input class="blue testTxt"  type="password" placeholder="必填" required data-msg-required="不能为空" name="userPass" value=""/>
               </div>
           </div>

           <div class="formLine">
               <div class="formInp">
                   <button class="btn-blue"  type="submit">保存数据</button>
               </div>
           </div>
       </div>
    </form>
</body>
<script type="text/javascript">
    $(function(){
        $("#orgId").val(parent.cellValOrgId());
        $("#subForm").validate({
            submitHandler: function() {
                send();
            }
        });
    });

    function send(){
        var data = $("#subForm").serialize();
        $.ajax({
            type: 'POST',
            url: 'add',
            data: data,
            dataType: 'json',
            success: function(data){
                if(data.code==200){
                    parent.callBack();
                }else{
                    $.ligerDialog.error('保存失败');
                }
            },
            error:function(){
                $.ligerDialog.error('保存失败');
            }
        });
    }
</script>
</html>